package com.xuexiang.xuidemo.page.text.supertextview;

import ohos.aafwk.content.Intent;
import ohos.agp.components.Image;

import com.xuexiang.xuidemo.ResourceTable;
import com.xuexiang.xuidemo.page.base.BasePageAbilitySlice;
import com.xuexiang.xuidemo.page.base.Page;
import com.xuexiang.xuidemo.page.text.TextAbility;
import com.xuexiang.xuidemo.util.DisplayUtils;

/**
 * 使用SuperTextView写一个用户中心界面
 *
 * @since 2021-04-06
 */
@Page(name = "使用SuperTextView写一个用户中心界面", subTitle = "仿苹果界面拖动回弹效果",
    action = "SuperTextCommonUseAbilitySlice", ability = TextAbility.class)
public class SuperTextCommonUseAbilitySlice extends BasePageAbilitySlice {
    private static final int INT_19 = 19;

    @Override
    protected int getLayoutId() {
        return ResourceTable.Layout_ability_text_super_common_user;
    }

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        Image headIv = findCastComponentById(ResourceTable.Id_riv_head_pic);
        headIv.setCornerRadius(DisplayUtils.vp2px(getContext(), INT_19));
    }
}
